package com.hghivln.erpwarehouse.system.common.lang;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 统一结果封装
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private int code;
    private String msg;
    private Object token;

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static final Result LOGGED = new Result(Constant.OK,"已登录");
    public static final Result NOT_LOGGED_IN = new Result(Constant.ERROR,"未登录");


    public static final Result LOGIN_SUCCESS = new Result(Constant.OK, "登录成功");
    public static final Result LOGIN_ERROR_PASS = new Result(Constant.ERROR, "用户名或密码错误");

    public static final Result LOGIN_ERROR_CODE = new Result(Constant.ERROR, "验证码错误");
    public static final Result LOGIN_EMTY_CODE = new Result(Constant.ERROR, "请输入验证码");

    public static final Result DELETE_SUCCESS = new Result(Constant.OK, "删除成功");
    public static final Result DELETE_ERROR = new Result(Constant.ERROR, "删除失败");

    public static final Result ADD_SUCCESS = new Result(Constant.OK, "添加成功");
    public static final Result ADD_ERROR = new Result(Constant.ERROR, "添加失败");

    public static final Result UPDATE_SUCCESS = new Result(Constant.OK, "修改成功");
    public static final Result UPDATE_ERROR = new Result(Constant.ERROR, "修改失败");
    public static final Result UPDATE_REFULSE = new Result(Constant.ERROR, "顶部菜单，不可修改");

    public static final Result DISPATCH_SUCCESS = new Result(Constant.OK, "分配成功");
    public static final Result DISPATCH_ERROR = new Result(Constant.OK, "分配失败");

    public static final Result DELETE_ERROR_NEWS = new Result(Constant.ERROR, "删除用户失败，该用户是其他用户的直属领导，请先修改该用户的下属的直属领导，再进行删除操作");
    public static final Result DELETE_QUERY = new Result();

    public static final Result RESET_SUCCESS = new Result(Constant.OK, "重置成功");
    public static final Result RESET_ERROE = new Result(Constant.OK, "重置失败");

    public static final Result BACKINPORT_SUCCESS = new Result(Constant.OK, "退货成功");
    public static final Result BACKINPORT_ERROR = new Result(Constant.ERROR, "退货失败");
    public static final Result SYNCCACHE_SUCCESS = new Result(Constant.OK, "同步缓存成功");

    public static final Result NOT_PERMISSION = new Result(Constant.ERROR, "无权限");

    public static final Result UPDATE_PWD_SUCCESS = new Result(Constant.OK, "密码修改成功");
    public static final Result UPDATE_PWD_ERROR = new Result(Constant.ERROR, "旧密码输入错误");
    public static final Result UPDATE_AGAINPWD_ERROR = new Result(Constant.ERROR, "两次密码输入不一样");



}
